package com.financing.platform.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IPublicActivitiesDao;
import com.financing.platform.dto.PublicActivitiesDTO;
import com.financing.platform.util.SqlName;
import com.financing.platform.vo.PublicActivitiesVO;

@Repository("publicActivitiesDaoImpl")
public class PublicActivitiesDaoImpl extends BaseDaoImpl  implements IPublicActivitiesDao {

	public int addPublicActivites(PublicActivitiesDTO publicActivitiesDTO)
			throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.addPublicActivities, publicActivitiesDTO);
	}

	@SuppressWarnings("unchecked")
	public List<PublicActivitiesVO> publicActivitiesList(PublicActivitiesDTO publicActivitiesDTO) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.publicActivitiesList,publicActivitiesDTO);
	}

	public PublicActivitiesDTO queryPublicActivities(
			PublicActivitiesDTO publicActivitiesDTO) throws SQLException {
		return (PublicActivitiesDTO) this.sqlMapClient.queryForObject(SqlName.queryPublicActivities, publicActivitiesDTO);
	}

	public int updatePublicActivities(PublicActivitiesDTO publicActivitiesDTO)
			throws SQLException {
		return this.sqlMapClient.update(SqlName.updatePublicActivities,publicActivitiesDTO);
	}

	@Override
	public int publicActivitiesListCount(PublicActivitiesDTO publicActivitiesDTO)
			throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.publicActivitiesListCount,publicActivitiesDTO);
	}

}
